/*
 * Copyright 2013 Nicholas Bilyk
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package jasper.model.elements;

/**
 * The any element enables the author to extend the XML document with elements not specified by the schema.
 *
 * Parent elements: choice, sequence
 *
 * Source: http://www.w3schools.com/schema/el_any.asp
 *
 * @author nbilyk
 */
public class Any extends SchemaNode {

	/**
	 * Optional. Specifies a unique ID for the element
	 */
	public String id;

	/**
	 * Optional. Specifies the maximum number of times the any element can occur in the parent element.
	 * The value can be any number >= 0, or if you want to set no limit on the maximum number, use the
	 * value "unbounded". Default value is 1.
	 */
	public int maxOccurs;

	/**
	 * Optional. Specifies the minimum number of times the any element can occur in the parent element.
	 * The value can be any number >= 0. Default value is 1.
	 */
	public int minOccurs;

	/**
	 * Optional. Specifies the namespaces containing the elements that can be used. Can be set to one of the following:
	 *   ##any - elements from any namespace is allowed (this is default)
	 *   ##other - elements from any namespace that is not the namespace of the parent element can be present
	 *   ##local - elements must come from no namespace
	 *   ##targetNamespace - elements from the namespace of the parent element can be present
	 * List of {URI references of namespaces, ##targetNamespace, ##local} - elements from a space-delimited list of the
	 * namespaces can be present
	 */
	public String namespace;

	/**
	 * Optional. Specifies how the XML processor should handle validation against the elements specified by this any
	 * element. Can be set to one of the following:
	 *  - strict - the XML processor must obtain the schema for the required namespaces and validate the elements
	 *    (this is default).
	 *  - lax - same as strict but; if the schema cannot be obtained, no errors will occur.
	 *  - skip - The XML processor does not attempt to validate any elements from the specified namespaces.
	 */
	public String processContents;

	public Any() {
		allowedParents = new Class[] { Choice.class, Sequence.class };
	}
}
